package com.edu.controller;

import java.io.FileNotFoundException;
import java.io.IOException;
import java.util.List;

import javax.servlet.http.HttpServletRequest;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.HttpStatus;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.multipart.MultipartFile;
import org.springframework.web.multipart.MultipartHttpServletRequest;

import com.edu.exception.FileException;
import com.edu.service.FileService;
import com.edu.util.ZFilenameUtils;
import com.edu.vo.FileVO;
import com.edu.vo.PageUtils;
import com.edu.vo.ResultVO;
import com.edu.vo.ServerConstant;

@Controller
public class IndexController {

	@Autowired
	private FileService fileService;
	private final Logger logger = LoggerFactory.getLogger(this.getClass());

	
	/***************************************************
	 * URL: /index /  index(): 主页
	 * 
	 * @return  String  index.jsp
	 ****************************************************/
	@RequestMapping(value = { "/index", "/" }, method = RequestMethod.GET)
	public String index() {
		return "index";
	}	

//	@RequestMapping(value = "index/file/upload", method = RequestMethod.POST)
//	public String uploadFile(HttpServletRequest req){
//		MultipartHttpServletRequest mreq = (MultipartHttpServletRequest) req;
//		MultipartFile file = mreq.getFile("file");
//		try {
//			fileService.uploadFile(file);
//		} catch (FileNotFoundException e) {
//			e.printStackTrace();
//		}
//		return "redirect:/index";
//	}
//	
	



}
